﻿using DesignPatternSample.MediatorPattern;
using System;

namespace DesignPatternSample
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Test();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadKey();
            Console.WriteLine("Hello World!");
        }

        private static void Test()
        {
            var mediator = new Mediator();
            var colleagueA = new ColleagueA(mediator);
            var colleagueB = new ColleagueB(mediator);
            mediator.colleagueA = colleagueA;
            mediator.colleagueB = colleagueB;
            mediator.SendMessage("(｡･∀･)ﾉﾞ嗨，周五了，嫖娼去吗？我请客", colleagueA);
            mediator.SendMessage("Go go go.", colleagueB);
        }
    }
}
